summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-09 10:51:26 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-09 10:51:56 +0200
commit91ceb21d1d5f6447a47853b6625fb51d2f21cf16 (patch)
tree5148e804a2d1bc8e794d8565bd81606f0bac29e0
parent662d1db6ee1a78c298acc11e7528e73c0415fc75 (diff)
small refactoring to reduce memory usage of static data
-rw-r--r--src/corelib/codecs/qisciicodec.cpp2
-rw-r--r--src/corelib/tools/qlocale.cpp2
-rw-r--r--src/corelib/tools/qlocale_data_p.h10
-rw-r--r--src/corelib/xml/qxmlstream.cpp7
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py6
5 files changed, 13 insertions, 14 deletions
diff --git a/src/corelib/codecs/qisciicodec.cpp b/src/corelib/codecs/qisciicodec.cpp
index dd2bc8d38a..de1e47796c 100644
--- a/src/corelib/codecs/qisciicodec.cpp
+++ b/src/corelib/codecs/qisciicodec.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
struct Codecs {
- const char *name;
+ const char name[10];
ushort base;
};
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 00132d7543..4898e1086c 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -772,7 +772,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
Instead it can return a "Windows code". This maps windows codes to ISO country names. */
struct WindowsToISOListElt {
- int windows_code;
+ ushort windows_code;
char iso_name[6];
};
diff --git a/src/corelib/tools/qlocale_data_p.h b/src/corelib/tools/qlocale_data_p.h
index 37f59a421a..e0eecf37ef 100644
--- a/src/corelib/tools/qlocale_data_p.h
+++ b/src/corelib/tools/qlocale_data_p.h
@@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE
*/
struct CountryLanguage
{
- quint32 languageId;
- quint32 countryId;
+ quint16 languageId;
+ quint16 countryId;
};
static const CountryLanguage ImperialMeasurementSystems[] = {
{ 31, 225 },
@@ -83,7 +83,7 @@ static const int ImperialMeasurementSystemsCount =
*/
-static const uint locale_index[] = {
+static const quint16 locale_index[] = {
0, // unused
0, // C
0, // Abkhazian
@@ -2313,7 +2313,7 @@ static const char language_name_list[] =
"Chewa\0"
;
-static const uint language_name_index[] = {
+static const quint16 language_name_index[] = {
0, // Unused
8, // C
10, // Abkhazian
@@ -2727,7 +2727,7 @@ static const char country_name_list[] =
"SerbiaAndMontenegro\0"
;
-static const uint country_name_index[] = {
+static const quint16 country_name_index[] = {
0, // AnyCountry
8, // Afghanistan
20, // Albania
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 5e1fec343c..fddcecf415 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -629,7 +629,7 @@ while (<STDIN>) {
$sizes[$i++] = $counter;
$counter += length 1 + $_;
}
-print " \"\\0\";\n\nstatic const int QXmlStreamReader_tokenTypeString_indices[] = {\n ";
+print " \"\\0\";\n\nstatic const short QXmlStreamReader_tokenTypeString_indices[] = {\n ";
for ($j = 0; $j < $i; ++$j) {
printf "$sizes[$j], ";
}
@@ -660,10 +660,9 @@ static const char QXmlStreamReader_tokenTypeString_string[] =
"Comment\0"
"DTD\0"
"EntityReference\0"
- "ProcessingInstruction\0"
- "\0";
+ "ProcessingInstruction\0";
-static const int QXmlStreamReader_tokenTypeString_indices[] = {
+static const short QXmlStreamReader_tokenTypeString_indices[] = {
0, 8, 16, 30, 42, 55, 66, 77, 85, 89, 105, 0
};
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py
index af6da3348c..d625cfd056 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/local_database/qlocalexml2cpp.py
@@ -318,7 +318,7 @@ def main():
print
# Locale index
- print "static const uint locale_index[] = {"
+ print "static const quint16 locale_index[] = {"
print " 0, // unused"
index = 0
for key in language_map.keys():
@@ -454,7 +454,7 @@ def main():
print
# Language name index
- print "static const uint language_name_index[] = {"
+ print "static const quint16 language_name_index[] = {"
print " 0, // Unused"
index = 8
for key in language_map.keys():
@@ -477,7 +477,7 @@ def main():
print
# Country name index
- print "static const uint country_name_index[] = {"
+ print "static const quint16 country_name_index[] = {"
print " 0, // AnyCountry"
index = 8
for key in country_map.keys():